package cn.wolfcode.shop.server.mapper;

import cn.wolfcode.shop.api.domain.Catalog;

import java.util.List;

public interface CatalogMapper {

    int delete(Long id);

    int save(Catalog record);

    Catalog get(Long id);

    List<Catalog> list();

    List<Catalog> listCatalogs();//brand类需要

    int update(Catalog record);

    List<Catalog> selectRootTree();

    List<Catalog> selectSonTree(Long parentId);

    Catalog selectParentBySonId(Long id);

    /**
     * 删除父目录下的分类
     * @param parentCatalogId
     */
    void deleteSonTree(Long parentCatalogId);

    List<Long> selectSonTreeId(Long parentCatalogId);
}